package main

import (
	"log/slog"
	"os"
)

func initSlogLogger(logpath string, loglevel slog.Level) *slog.Logger {
	file, err := os.Create(logpath)
	if err != nil {
		panic(err)
	}

	return slog.New(slog.NewTextHandler(file, &slog.HandlerOptions{Level: loglevel}))
	// return slog.New(slog.NewJSONHandler(file, &slog.HandlerOptions{Level: loglevel}))
}
